-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Add new fields and filtering options for availabilities and rentable … #19317
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
WalkthroughExpands Booking Experts actions with many optional filters, sorters, and limiters for availabilities and rentable-type availabilities; adds constants, a parse utility, new app propDefinitions and list endpoints; and bumps component package and several action/source versions. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes
Possibly related PRs
Suggested labels
Suggested reviewers
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 8
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (5)
components/booking_experts/actions/list-availabilities/list-availabilities.mjs(2 hunks)components/booking_experts/actions/list-rentabletype-availabilities/list-rentabletype-availabilities.mjs(3 hunks)components/booking_experts/booking_experts.app.mjs(2 hunks)components/booking_experts/common/constants.mjs(1 hunks)components/booking_experts/common/utils.mjs(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
components/booking_experts/actions/list-rentabletype-availabilities/list-rentabletype-availabilities.mjs (3)
components/booking_experts/common/constants.mjs (2)
FIELDS_OPTIONS(1-12)FIELDS_OPTIONS(1-12)components/booking_experts/actions/list-availabilities/list-availabilities.mjs (1)
parseObject(464-536)components/booking_experts/common/utils.mjs (2)
parseObject(1-24)parseObject(1-24)
components/booking_experts/actions/list-availabilities/list-availabilities.mjs (2)
components/booking_experts/common/constants.mjs (6)
WEEKDAY_OPTIONS(80-109)WEEKDAY_OPTIONS(80-109)SORTERS_OPTIONS(37-78)SORTERS_OPTIONS(37-78)LIMITERS_OPTIONS(14-35)LIMITERS_OPTIONS(14-35)components/booking_experts/common/utils.mjs (2)
parseObject(1-24)parseObject(1-24)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: Lint Code Base
- GitHub Check: pnpm publish
- GitHub Check: Publish TypeScript components
- GitHub Check: Verify TypeScript components
🔇 Additional comments (6)
components/booking_experts/common/utils.mjs (1)
1-24: LGTM!The
parseObjectutility handles various input types robustly with appropriate try/catch guards for JSON parsing failures. The function gracefully falls back to the original value when parsing fails, which is the correct behavior for this use case.components/booking_experts/booking_experts.app.mjs (1)
462-481: LGTM!The new API methods follow the established patterns consistently and correctly delegate to
_makeRequestwith appropriate paths.components/booking_experts/common/constants.mjs (1)
1-109: LGTM!Constants are well-structured with clear labels. The weekday values correctly follow the standard convention (0=Sunday through 6=Saturday).
components/booking_experts/actions/list-rentabletype-availabilities/list-rentabletype-availabilities.mjs (2)
72-92: LGTM!The run method correctly builds the params object with optional fields. The use of
parseObjectand optional chaining ensures graceful handling of undefined values.
52-58: Remove this review comment — the core premise is incorrect.The
FIELDS_OPTIONSconstant is not shared with thelist-availabilitiesaction. Thelist-availabilities.mjsfile does not import or useFIELDS_OPTIONSat all; itsfieldsparameter has no predefined options. These are separate endpoints with different implementations:list-availabilitiesqueries the general availabilities endpoint, whilelist-rentabletype-availabilitiesqueries the rentable_type_availability endpoint and appropriately provides field options specific to that context.Likely an incorrect or invalid review comment.
components/booking_experts/actions/list-availabilities/list-availabilities.mjs (1)
463-539: Overall implementation approach is sound.The comprehensive params object construction with
parseObjectand optional chaining handles the many optional filters appropriately. The structure aligns well with the PR objective of expanding filter support.
components/booking_experts/actions/list-availabilities/list-availabilities.mjs
Show resolved
Hide resolved
components/booking_experts/actions/list-availabilities/list-availabilities.mjs
Show resolved
Hide resolved
components/booking_experts/actions/list-availabilities/list-availabilities.mjs
Show resolved
Hide resolved
components/booking_experts/actions/list-availabilities/list-availabilities.mjs
Outdated
Show resolved
Hide resolved
...ooking_experts/actions/list-rentabletype-availabilities/list-rentabletype-availabilities.mjs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
components/booking_experts/actions/list-inventory-objects/list-inventory-objects.mjs (1)
53-55: Consider using parseObject utility for labels serialization.The PR context mentions a new
parseObjectutility introduced in shared constants. Currently, the code manually joins labels with a comma. IfparseObjectis the standard way to serialize complex fields in this PR, apply it here for consistency.Please confirm whether labels should use:
-"filter[labels]": this.labels - ? this.labels.join(",") - : undefined, +"filter[labels]": this.labels + ? parseObject(this.labels) + : undefined,(or similar, depending on the intended signature of
parseObject)components/booking_experts/actions/list-bookings/list-bookings.mjs (1)
67-77: Channel filter uses undefined prop; created/updated filters have no propsIn the
paramsobject:
"filter[channel]"usesthis.listAdministrationChannels, but there is nolistAdministrationChannelsprop defined. The available prop isadministrationChannelId(Line 32). As written, the channel filter is never actually applied."filter[created_at]"and"filter[updated_at]"referencethis.createdAtandthis.updatedAt, but there are no corresponding props, so these filters are effectively dead code.This breaks the advertised “Filter by channel” behavior and leaves the created/updated filters in a half‑wired state.
Consider updating the action like this:
const { data } = await this.bookingExperts.listBookings({ $, administrationId: this.administrationId, params: { "filter[owner]": this.ownerId, - "filter[channel]": this.listAdministrationChannels, - "filter[reservations]": this.reservationId, - "filter[created_at]": this.createdAt, - "filter[updated_at]": this.updatedAt, + "filter[channel]": this.administrationChannelId, + "filter[reservations]": this.reservationId, + // If you intend to support these, add corresponding props to `props`: + // "filter[created_at]": this.createdAt, + // "filter[updated_at]": this.updatedAt, "page[number]": this.page, "page[size]": this.perPage, }, });If
createdAt/updatedAtfilters should be user-configurable, also add explicit props for them to thepropssection; otherwise, remove those params entirely to avoid confusion.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (15)
components/booking_experts/actions/add-guest-to-reservation/add-guest-to-reservation.mjs(1 hunks)components/booking_experts/actions/create-agenda-period/create-agenda-period.mjs(1 hunks)components/booking_experts/actions/delete-guest/delete-guest.mjs(1 hunks)components/booking_experts/actions/get-booking/get-booking.mjs(1 hunks)components/booking_experts/actions/get-complex-prices/get-complex-prices.mjs(1 hunks)components/booking_experts/actions/get-reservation/get-reservation.mjs(1 hunks)components/booking_experts/actions/list-bookings/list-bookings.mjs(1 hunks)components/booking_experts/actions/list-inventory-objects/list-inventory-objects.mjs(1 hunks)components/booking_experts/actions/list-reservations/list-reservations.mjs(1 hunks)components/booking_experts/actions/search-contacts/search-contacts.mjs(1 hunks)components/booking_experts/actions/update-guest/update-guest.mjs(1 hunks)components/booking_experts/sources/booking-updated/booking-updated.mjs(1 hunks)components/booking_experts/sources/inventory-object-updated/inventory-object-updated.mjs(1 hunks)components/booking_experts/sources/new-booking-created/new-booking-created.mjs(1 hunks)components/booking_experts/sources/new-inventory-object-created/new-inventory-object-created.mjs(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Verify TypeScript components
- GitHub Check: Publish TypeScript components
- GitHub Check: Lint Code Base
🔇 Additional comments (14)
components/booking_experts/sources/new-booking-created/new-booking-created.mjs (1)
8-8: Version bump looks consistent with broader Booking Experts changesThe version increment to
0.0.4matches the pattern of PR-wide version bumps for Booking Experts components and doesn’t alter runtime behavior for this source. As long as any external references (docs, templates, or catalog metadata) expect the new version, this is good to go.components/booking_experts/sources/inventory-object-updated/inventory-object-updated.mjs (1)
8-8: Verify scope: version bump appears misaligned with PR objectives.This file handles inventory object updates, but the PR objectives specifically request expanding filters for availability endpoints (GET availabilities and GET rentable_type availabilities). The version bump to "0.0.4" lacks accompanying functional changes and appears out of scope.
Please clarify whether this version bump is intentional, part of a broader versioning strategy across multiple files, or should be removed from this PR.
components/booking_experts/actions/add-guest-to-reservation/add-guest-to-reservation.mjs (1)
7-7: Consider whether version bump is warranted without functional changes.The version has been bumped from "0.0.4" to "0.0.5", but according to the enriched summary and the provided code, this action has no behavioral changes, error handling modifications, or control flow updates. Semantic versioning typically reserves patch version bumps for bug fixes or minor functional improvements.
If this is a systematic version bump across all related actions in the PR, this may be appropriate for consistency. However, if this action is unchanged while related actions are being enhanced, the version may remain at "0.0.4".
Could you clarify whether this version bump is intentional? Is this part of a systematic versioning strategy across all Booking Experts actions, or should it remain at "0.0.4" given no functional changes?
components/booking_experts/actions/create-agenda-period/create-agenda-period.mjs (1)
7-7: Clarify the rationale for the version bump.This file has no functional changes—only a version increment from 0.0.4 to 0.0.5. Since the PR objectives focus on expanding availability filters (in
list-availabilitiesandlist-rentabletype-availabilities), it's unclear why this unrelated action should be versioned.Is this a collateral bump across all Booking Experts actions, or should this change be excluded from the PR?
components/booking_experts/actions/search-contacts/search-contacts.mjs (1)
4-13: Version bump to 0.0.5 is appropriate and non-breakingPatch version increment with no logic changes is consistent with current behavior; this action’s runtime behavior remains unchanged.
components/booking_experts/actions/delete-guest/delete-guest.mjs (1)
7-7: Clarify the rationale for the version bump without functional changes.The version is incremented from
0.0.2to0.0.3, but the enriched summary notes that this action "does not incorporate these changes directly, it only reflects the version bump." This is inconsistent with semantic versioning, where a patch bump (0.0.2 → 0.0.3) should accompany a bug fix or compatible change, but the action has no functional modifications.Either this is part of a coordinated versioning strategy across all Booking Experts actions (which should be documented), or the version bump should not be applied to actions without functional changes. Per the PR objectives, this PR is focused on expanding filters for availabilities; it's unclear whether delete-guest should be included.
components/booking_experts/actions/get-reservation/get-reservation.mjs (1)
7-7: Clarify version bump rationale.The version is bumped from 0.0.1 to 0.0.2, but per the AI summary, there are no changes to logic, behavior, or control flow in this file. The PR objectives (#19270) specifically target expanding GET availabilities and GET rentable_type availabilities, not the get-reservation endpoint.
Is this version bump part of a coordinated release pattern across multiple actions, or should it be reverted if no functional changes are intended?
components/booking_experts/actions/update-guest/update-guest.mjs (1)
7-7: Version bump to 0.0.3 looks correctThis is a non-functional metadata update and is consistent with bumping action versions alongside broader Booking Experts changes.
components/booking_experts/actions/list-inventory-objects/list-inventory-objects.mjs (1)
7-7: Verify version bump aligns with PR scope and actual changes.The version was bumped from 0.0.4 to 0.0.5, but the AI summary indicates "no changes to logic, arguments, or runtime behavior." Additionally, PR #19270 targets availability actions, not inventory objects. Clarify whether:
- This file is in scope for the PR (or if this version bump should be reverted)
- What substantive change warrants the version bump if no logic/args changed
components/booking_experts/sources/booking-updated/booking-updated.mjs (1)
8-8: Verify necessity of version bump.The file contains only a version change (0.0.3 → 0.0.4) with no functional or logic modifications. Based on the AI summary, no behavior changes are present.
Confirm whether this version bump is necessary given that:
- This source handles booking updates, not availabilities (which are the focus of the PR).
- No usage of the new utilities (
parseObject) or constants (FIELDS_OPTIONS, etc.) introduced in this PR appears in this file.If this source doesn't directly consume the new capabilities being added in the PR, consider whether the version bump should be deferred or consolidated with other changes.
components/booking_experts/sources/new-inventory-object-created/new-inventory-object-created.mjs (1)
8-8: Verify the version bump rationale—no logic changes in this source.The version is incremented from 0.0.3 to 0.0.4, but no functional changes, new features, or bug fixes are present in this source file. The PR's primary objective (expanding filters for availabilities) does not affect this source, and it does not use the new utilities or constants mentioned in the broader PR summary.
Semantic versioning typically ties version increments to actual changes. If this is a blanket version bump across the integration, clarify the rationale. If it was unintentional, consider reverting it.
components/booking_experts/actions/get-booking/get-booking.mjs (1)
7-7: Clarify the rationale for this version bump.This file shows only a version bump without any functional changes to logic, props, or API calls. The PR objectives focus on expanding filters for GET availabilities and GET rentable_type availabilities endpoints, which are unrelated to the "Get Booking" action.
Verify whether:
- This version bump is part of a coordinated versioning strategy across all actions in the PR
- This action requires updates to use new utilities or constants introduced in the PR
- This file should be included in this PR at all, or if it was inadvertently modified
components/booking_experts/actions/list-bookings/list-bookings.mjs (1)
7-7: Version bump-only change looks consistentThe version bump to
"0.0.5"is consistent with the PR pattern of bumping Booking Experts action versions and does not introduce behavioral changes in this file.components/booking_experts/actions/list-reservations/list-reservations.mjs (1)
7-7: No version bump exists in this file within the current PR.The version field (line 7) shows
"0.0.2", which was already set in a previous commit. Git diff returns no changes for this file, confirming it was not modified in the current PR. The review comment's claim that the version was "bumped from '0.0.1' to '0.0.2'" is incorrect—no version change occurred in this PR for this file.While the commit message references updating version numbers for booking experts actions, the list-reservations action was not part of the current diff under review.
components/booking_experts/actions/get-complex-prices/get-complex-prices.mjs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
♻️ Duplicate comments (2)
components/booking_experts/actions/list-availabilities/list-availabilities.mjs (2)
27-32: Missingoptionsforfieldsprop.Unlike
list-rentabletype-availabilities.mjswhich usesFIELDS_OPTIONS, this prop has no options defined. Consider addingFIELDS_OPTIONSto provide a consistent user experience with selectable field values.
156-177:discountCampaignIdandinventoryObjectIdreference non-existentadministrationIdprop.The prop definitions reference
c.administrationId, but this action only hasadministrationIds(plural, array type) defined at lines 104-113. The callbacks will receiveundefined, causing the dropdown options to fail loading.Consider one of these approaches:
- Add a singular
administrationIdprop for these dependent fields- Change the dependency to use the first element of
administrationIds:discountCampaignId: { propDefinition: [ bookingExperts, "discountCampaignId", (c) => ({ - administrationId: c.administrationId, + administrationId: c.administrationIds?.[0], }), ], description: "Filter on discount campaign ID.", optional: true, }, inventoryObjectId: { propDefinition: [ bookingExperts, "inventoryObjectId", (c) => ({ - administrationId: c.administrationId, + administrationId: c.administrationIds?.[0], }), ], description: "Filter on inventory object ID.", optional: true, },Note: Option 2 may not provide the best UX since it only considers the first administration.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (2)
components/booking_experts/actions/list-availabilities/list-availabilities.mjs(2 hunks)components/booking_experts/actions/list-rentabletype-availabilities/list-rentabletype-availabilities.mjs(3 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-09-12T07:49:36.125Z
Learnt from: matyascimbulka
Repo: PipedreamHQ/pipedream PR: 18308
File: components/apify/actions/run-task-synchronously/run-task-synchronously.mjs:70-0
Timestamp: 2025-09-12T07:49:36.125Z
Learning: The Apify Task object always contains the `options` field according to the official API documentation, making nested destructuring like `options: { build }` safe to use without additional checks.
Applied to files:
components/booking_experts/actions/list-availabilities/list-availabilities.mjs
📚 Learning: 2025-09-11T01:53:51.070Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 18334
File: components/buddee/actions/list-employees/list-employees.mjs:147-155
Timestamp: 2025-09-11T01:53:51.070Z
Learning: In Buddee list-employees action, the "manager" prop should be a boolean type to filter employees who have direct reports, not an employeeId propDefinition which would send an employee ID instead of the expected boolean value.
Applied to files:
components/booking_experts/actions/list-availabilities/list-availabilities.mjs
🧬 Code graph analysis (1)
components/booking_experts/actions/list-availabilities/list-availabilities.mjs (2)
components/booking_experts/common/constants.mjs (6)
WEEKDAY_OPTIONS(80-109)WEEKDAY_OPTIONS(80-109)SORTERS_OPTIONS(37-78)SORTERS_OPTIONS(37-78)LIMITERS_OPTIONS(14-35)LIMITERS_OPTIONS(14-35)components/booking_experts/common/utils.mjs (2)
parseObject(1-24)parseObject(1-24)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: pnpm publish
- GitHub Check: Publish TypeScript components
- GitHub Check: Verify TypeScript components
- GitHub Check: Lint Code Base
🔇 Additional comments (2)
components/booking_experts/actions/list-availabilities/list-availabilities.mjs (1)
49-54: Previously flagged issues have been fixed.Good work addressing the past review feedback:
includeSemanticSegmentCountsis now properly defined as a prop (lines 49-54)wdayparsing now safely handles undefined values with a conditional check (lines 484-486)Also applies to: 484-486
components/booking_experts/actions/list-rentabletype-availabilities/list-rentabletype-availabilities.mjs (1)
10-10: Version bump to0.0.3is appropriate for the expanded public propsGiven the new public inputs (
fields,include,multibookSafetyMargin) and behavior changes, incrementing the action version to0.0.3is a reasonable, backwards‑compatible update.
...ooking_experts/actions/list-rentabletype-availabilities/list-rentabletype-availabilities.mjs
Show resolved
Hide resolved
...ooking_experts/actions/list-rentabletype-availabilities/list-rentabletype-availabilities.mjs
Show resolved
Hide resolved
jcortes
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @luancazarine it is looking good! However please fix conflicts first!
…types - Introduced new fields for filtering availabilities and rentable types, including `fields`, `include`, and `multibookSafetyMargin`. - Added methods for listing rentable segments, amenities, and discount campaigns in the booking experts app. - Updated version numbers for actions related to availabilities and rentable type availabilities. - Created constants for fields, limiters, sorters, and weekdays to enhance filtering capabilities.
8164387 to
a3f5d2f
Compare
…k safety margin naming in availabilities actions - Introduced `includeSemanticSegmentCounts` option to enhance metadata results. - Renamed `multibookSsafetyMargin` to `multibookSafetyMargin` for consistency in rentable type availabilities. - Updated parsing logic for `wday` filter to handle undefined values correctly.
a3f5d2f to
eb06345
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
♻️ Duplicate comments (8)
components/booking_experts/actions/get-complex-prices/get-complex-prices.mjs (1)
7-7: LGTM!Version bump is consistent with the package version update to 0.4.0. The coordinated version bumps across all actions address the previously noted version inconsistency concern.
components/booking_experts/actions/list-rentabletype-availabilities/list-rentabletype-availabilities.mjs (2)
52-64: Conditionally includefieldsandincludeparams to avoid undefined or empty values.The props are well-defined, but
parseObject(this.fields)?.join(",")at line 85 andparseObject(this.include)?.join(",")at line 86 may produceundefinedor empty strings. Consider only adding these params when there's at least one value to keep the wire format clean and align with the existingdate_rangehandling pattern.Apply this pattern:
async run({ $ }) { if ((!this.startDate && this.endDate) || (this.startDate && !this.endDate)) { throw new ConfigurationError("You should provide both the start and end date parameters."); } + + const fields = parseObject(this.fields); + const includes = parseObject(this.include); + const { data } = await this.bookingExperts.listRentableTypeAvailabilities({ $, channelId: this.channelId, rentableTypeId: this.rentableTypeId, params: { ...(this.startDate && this.endDate && { "date_range": `${this.startDate}..${this.endDate}`, }), - "fields[rentable_type_availability]": parseObject(this.fields)?.join(","), - "include": parseObject(this.include)?.join(","), - "multibook_safety_margin": this.multibookSafetyMargin, + ...(fields?.length && { + "fields[rentable_type_availability]": fields.join(","), + }), + ...(includes?.length && { + "include": includes.join(","), + }), + ...(this.multibookSafetyMargin != null && { + "multibook_safety_margin": this.multibookSafetyMargin, + }), }, });
65-70: Enforce "positive number" constraint formultibookSafetyMargin.The description states the safety margin "must be a positive number", but the prop accepts any integer including 0 or negative values. Consider adding validation to fail early with a clearer error message, similar to the start/end date validation.
Add this validation in the
runmethod:async run({ $ }) { if ((!this.startDate && this.endDate) || (this.startDate && !this.endDate)) { throw new ConfigurationError("You should provide both the start and end date parameters."); } + + if (this.multibookSafetyMargin != null && this.multibookSafetyMargin <= 0) { + throw new ConfigurationError("Multi-book Safety Margin must be a positive integer when provided."); + }components/booking_experts/booking_experts.app.mjs (3)
250-267: Potential runtime error ifattributes.nameis null/undefined.Line 263 accesses
attributes.name.enwhich will throw ifnameis null or undefined. Add defensive access with a fallback.Apply this diff:
return data?.map(({ id, attributes, }) => ({ - label: attributes.name.en, + label: attributes.name?.en ?? attributes.name ?? id, value: id, })) || [];
268-285: Same defensive access pattern needed foramenityId.Line 281 has the same unsafe access pattern as
rentableSegmentId. Apply null-safe access.Apply this diff:
return data?.map(({ id, attributes, }) => ({ - label: attributes.name.en, + label: attributes.name?.en ?? attributes.name ?? id, value: id, })) || [];
286-307: Same defensive access pattern needed fordiscountCampaignId.Line 303 has the same unsafe access pattern. Apply null-safe access with a fallback.
Apply this diff:
return data?.map(({ id, attributes, }) => ({ - label: attributes.name.en, + label: attributes.name?.en ?? attributes.name ?? id, value: id, })) || [];components/booking_experts/actions/list-availabilities/list-availabilities.mjs (2)
27-32: Consider addingFIELDS_OPTIONSfor consistency.Unlike
list-rentabletype-availabilities.mjswhich provides field options, this prop has none. Addingoptions: FIELDS_OPTIONSwould provide a consistent UX with selectable values.Import and add options:
import { + FIELDS_OPTIONS, LIMITERS_OPTIONS, SORTERS_OPTIONS, WEEKDAY_OPTIONS, } from "../../common/constants.mjs";fields: { type: "string[]", label: "Fields", description: "Fieldset of attributes to return. [See the documentation](https://developers.bookingexperts.com/reference/availabilities-index)", + options: FIELDS_OPTIONS, optional: true, },
156-177:discountCampaignIdandinventoryObjectIdreference non-existentadministrationIdprop.Lines 161 and 172 reference
c.administrationId, but this action only definesadministrationIds(plural, array type). The options callbacks will receiveundefined, preventing the dropdowns from loading.Consider using the first element of the array:
discountCampaignId: { propDefinition: [ bookingExperts, "discountCampaignId", (c) => ({ - administrationId: c.administrationId, + administrationId: c.administrationIds?.[0], }), ], description: "Filter on discount campaign ID.", optional: true, }, inventoryObjectId: { propDefinition: [ bookingExperts, "inventoryObjectId", (c) => ({ - administrationId: c.administrationId, + administrationId: c.administrationIds?.[0], }), ], description: "Filter on inventory object ID.", optional: true, },Note: This uses only the first administration ID, which may not provide ideal UX if multiple are selected.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (21)
components/booking_experts/actions/add-guest-to-reservation/add-guest-to-reservation.mjs(1 hunks)components/booking_experts/actions/create-agenda-period/create-agenda-period.mjs(1 hunks)components/booking_experts/actions/delete-guest/delete-guest.mjs(1 hunks)components/booking_experts/actions/get-booking/get-booking.mjs(1 hunks)components/booking_experts/actions/get-complex-prices/get-complex-prices.mjs(1 hunks)components/booking_experts/actions/get-reservation/get-reservation.mjs(1 hunks)components/booking_experts/actions/list-availabilities/list-availabilities.mjs(2 hunks)components/booking_experts/actions/list-bookings/list-bookings.mjs(1 hunks)components/booking_experts/actions/list-inventory-objects/list-inventory-objects.mjs(1 hunks)components/booking_experts/actions/list-rentabletype-availabilities/list-rentabletype-availabilities.mjs(3 hunks)components/booking_experts/actions/list-reservations/list-reservations.mjs(1 hunks)components/booking_experts/actions/search-contacts/search-contacts.mjs(1 hunks)components/booking_experts/actions/update-guest/update-guest.mjs(1 hunks)components/booking_experts/booking_experts.app.mjs(2 hunks)components/booking_experts/common/constants.mjs(1 hunks)components/booking_experts/common/utils.mjs(1 hunks)components/booking_experts/package.json(1 hunks)components/booking_experts/sources/booking-updated/booking-updated.mjs(1 hunks)components/booking_experts/sources/inventory-object-updated/inventory-object-updated.mjs(1 hunks)components/booking_experts/sources/new-booking-created/new-booking-created.mjs(1 hunks)components/booking_experts/sources/new-inventory-object-created/new-inventory-object-created.mjs(1 hunks)
🧰 Additional context used
🧠 Learnings (4)
📚 Learning: 2024-10-08T16:42:59.225Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 14229
File: components/americommerce/actions/update-customer/update-customer.mjs:89-94
Timestamp: 2024-10-08T16:42:59.225Z
Learning: When defining boolean properties in AmeriCommerce components (e.g., in `update-customer.mjs`), ensure that the label and description are consistent and clearly indicate the intent, especially when using negations like "No Account", to avoid confusion.
Applied to files:
components/booking_experts/booking_experts.app.mjs
📚 Learning: 2025-08-27T17:25:10.425Z
Learnt from: jverce
Repo: PipedreamHQ/pipedream PR: 18187
File: packages/connect-react/src/utils/type-guards.ts:23-33
Timestamp: 2025-08-27T17:25:10.425Z
Learning: In the connect-react package, the isOptionWithLabel type guard intentionally restricts value types to string|number for runtime filtering purposes, even though LabelValueOption<T> allows any T. This runtime behavior should be preserved over type safety improvements.
Applied to files:
components/booking_experts/booking_experts.app.mjs
📚 Learning: 2025-09-12T07:49:36.125Z
Learnt from: matyascimbulka
Repo: PipedreamHQ/pipedream PR: 18308
File: components/apify/actions/run-task-synchronously/run-task-synchronously.mjs:70-0
Timestamp: 2025-09-12T07:49:36.125Z
Learning: The Apify Task object always contains the `options` field according to the official API documentation, making nested destructuring like `options: { build }` safe to use without additional checks.
Applied to files:
components/booking_experts/actions/list-availabilities/list-availabilities.mjs
📚 Learning: 2025-09-11T01:53:51.070Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 18334
File: components/buddee/actions/list-employees/list-employees.mjs:147-155
Timestamp: 2025-09-11T01:53:51.070Z
Learning: In Buddee list-employees action, the "manager" prop should be a boolean type to filter employees who have direct reports, not an employeeId propDefinition which would send an employee ID instead of the expected boolean value.
Applied to files:
components/booking_experts/actions/list-availabilities/list-availabilities.mjs
🧬 Code graph analysis (3)
components/booking_experts/common/utils.mjs (2)
components/booking_experts/actions/list-availabilities/list-availabilities.mjs (1)
parseObject(470-544)components/booking_experts/actions/list-rentabletype-availabilities/list-rentabletype-availabilities.mjs (1)
parseObject(76-89)
components/booking_experts/actions/list-rentabletype-availabilities/list-rentabletype-availabilities.mjs (3)
components/booking_experts/common/constants.mjs (2)
FIELDS_OPTIONS(1-12)FIELDS_OPTIONS(1-12)components/booking_experts/actions/list-availabilities/list-availabilities.mjs (1)
parseObject(470-544)components/booking_experts/common/utils.mjs (2)
parseObject(1-24)parseObject(1-24)
components/booking_experts/actions/list-availabilities/list-availabilities.mjs (2)
components/booking_experts/common/constants.mjs (6)
WEEKDAY_OPTIONS(80-109)WEEKDAY_OPTIONS(80-109)SORTERS_OPTIONS(37-78)SORTERS_OPTIONS(37-78)LIMITERS_OPTIONS(14-35)LIMITERS_OPTIONS(14-35)components/booking_experts/common/utils.mjs (2)
parseObject(1-24)parseObject(1-24)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: Lint Code Base
- GitHub Check: pnpm publish
- GitHub Check: Publish TypeScript components
- GitHub Check: Verify TypeScript components
🔇 Additional comments (16)
components/booking_experts/actions/add-guest-to-reservation/add-guest-to-reservation.mjs (1)
8-8: Version bump to 0.0.7 looks appropriateMetadata-only change; no behavioral differences introduced here. Patch bump is consistent with a non-breaking update elsewhere in the Booking Experts components.
components/booking_experts/actions/create-agenda-period/create-agenda-period.mjs (1)
7-7: Verify the version bump is aligned with PR scope.This action appears unrelated to the PR objectives (expanding filters for availabilities endpoints). While the version bump may be part of a broad package-wide update, please confirm that this change is intentional and necessary for this PR, or whether it should be reserved for a separate versioning commit.
components/booking_experts/sources/new-inventory-object-created/new-inventory-object-created.mjs (2)
8-8: Verify version bump is intentional and coordinated.Line 8 bumps the version from "0.0.4" to "0.0.5", but the source logic itself has no functional changes. The PR objectives focus on expanding availability filters, not inventory object sources.
Confirm that:
- This version bump is part of a coordinated module-level release (not a stray change)
- Other related files in this PR have corresponding updates
Since I do not have visibility into all files modified in this PR, please verify that this version bump aligns with the broader changes and is not unintended.
1-40: Source structure and logic look correct.No functional issues detected. The source correctly inherits from the polling base, defines the inventory object resource, and generates appropriate metadata. If the version bump is justified as a coordinated module update, this change is safe to merge.
components/booking_experts/actions/get-reservation/get-reservation.mjs (1)
7-7: Verify whether the version bump is necessary without functional changes.Line 7 bumps the version from
0.0.2to0.0.3, but there are no functional changes to this action in the provided diff. Version bumps should reflect actual changes.
- Is this version bump part of a broader component package version update that applies to all actions?
- If yes, clarify this in the commit message or PR description for context.
- If this action had no changes, consider reverting the version to the original.
components/booking_experts/actions/list-reservations/list-reservations.mjs (1)
7-7: This is a new file being created, not a modified file with a version bump.The version "0.0.3" is the initial version for this newly created action file, not a bump from "0.0.2". The git diff shows
list-reservations.mjsas a new file (new file mode 100644), which means it did not exist in the repository before this commit and all concerns about unjustified version bumping are invalid.Likely an incorrect or invalid review comment.
components/booking_experts/sources/inventory-object-updated/inventory-object-updated.mjs (1)
8-8: LGTM!Version bump is consistent with the package version update to 0.4.0.
components/booking_experts/actions/get-booking/get-booking.mjs (1)
7-7: LGTM!Version bump is consistent with the package version update to 0.4.0.
components/booking_experts/actions/delete-guest/delete-guest.mjs (1)
7-7: LGTM!Version bump is consistent with the package version update to 0.4.0.
components/booking_experts/actions/list-inventory-objects/list-inventory-objects.mjs (1)
7-7: LGTM!Version bump is consistent with the package version update to 0.4.0.
components/booking_experts/common/constants.mjs (1)
1-109: LGTM! Well-structured constants for API parameters.The constants are well-organized and follow consistent patterns:
- FIELDS_OPTIONS provides valid field names in snake_case
- LIMITERS_OPTIONS and SORTERS_OPTIONS use descriptive labels with matching API values
- WEEKDAY_OPTIONS uses standard Sunday=0 convention with string values
components/booking_experts/actions/list-rentabletype-availabilities/list-rentabletype-availabilities.mjs (2)
3-4: LGTM!The imports are correctly added to support the new filtering functionality.
10-10: LGTM!Version bump is appropriate for the added filtering functionality.
components/booking_experts/booking_experts.app.mjs (1)
495-514: LGTM!The new API methods are correctly implemented and follow the established patterns in the codebase.
components/booking_experts/actions/list-availabilities/list-availabilities.mjs (2)
2-7: LGTM!The imports are correctly added to support the comprehensive filtering, sorting, and limiting functionality.
484-486: LGTM!The conditional parsing of
wdaycorrectly preventsNaNvalues from being passed to the API. This addresses the previous concern about unsafe parsing.
components/booking_experts/actions/list-availabilities/list-availabilities.mjs
Show resolved
Hide resolved
|
Hi everyone, all test cases are passed! Ready for release! Test reports
|
#19317) * Add new fields and filtering options for availabilities and rentable types - Introduced new fields for filtering availabilities and rentable types, including `fields`, `include`, and `multibookSafetyMargin`. - Added methods for listing rentable segments, amenities, and discount campaigns in the booking experts app. - Updated version numbers for actions related to availabilities and rentable type availabilities. - Created constants for fields, limiters, sorters, and weekdays to enhance filtering capabilities. * Update version number for @pipedream/booking_experts to 0.4.0 * Add new option for including semantic segment counts and fix multibook safety margin naming in availabilities actions - Introduced `includeSemanticSegmentCounts` option to enhance metadata results. - Renamed `multibookSsafetyMargin` to `multibookSafetyMargin` for consistency in rentable type availabilities. - Updated parsing logic for `wday` filter to handle undefined values correctly.
Resolves #19270
Summary by CodeRabbit
New Features
Chores
✏️ Tip: You can customize this high-level summary in your review settings.